home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gcc / gcc258s.zoo / gcc.info-18 < prev    next >
Encoding:
GNU Info File  |  1993-11-30  |  47.4 KB  |  1,027 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Published by the Free Software Foundation 675 Massachusetts Avenue
  7. Cambridge, MA 02139 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  10.  
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.  
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License" and "Protect
  18. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  19. original, and provided that the entire resulting derived work is
  20. distributed under the terms of a permission notice identical to this
  21. one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the sections entitled "GNU General Public
  26. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  27. permission notice, may be included in translations approved by the Free
  28. Software Foundation instead of in the original English.
  29.  
  30. File: gcc.info,  Node: Obsolete Register Macros,  Prev: Stack Registers,  Up: Registers
  31.  
  32. Obsolete Macros for Controlling Register Usage
  33. ----------------------------------------------
  34.  
  35.    These features do not work very well.  They exist because they used
  36. to be required to generate correct code for the 80387 coprocessor of the
  37. 80386.  They are no longer used by that machine description and may be
  38. removed in a later version of the compiler.  Don't use them!
  39.  
  40. `OVERLAPPING_REGNO_P (REGNO)'
  41.      If defined, this is a C expression whose value is nonzero if hard
  42.      register number REGNO is an overlapping register.  This means a
  43.      hard register which overlaps a hard register with a different
  44.      number.  (Such overlap is undesirable, but occasionally it allows
  45.      a machine to be supported which otherwise could not be.)  This
  46.      macro must return nonzero for *all* the registers which overlap
  47.      each other.  GNU CC can use an overlapping register only in
  48.      certain limited ways.  It can be used for allocation within a
  49.      basic block, and may be spilled for reloading; that is all.
  50.  
  51.      If this macro is not defined, it means that none of the hard
  52.      registers overlap each other.  This is the usual situation.
  53.  
  54. `INSN_CLOBBERS_REGNO_P (INSN, REGNO)'
  55.      If defined, this is a C expression whose value should be nonzero if
  56.      the insn INSN has the effect of mysteriously clobbering the
  57.      contents of hard register number REGNO.  By "mysterious" we mean
  58.      that the insn's RTL expression doesn't describe such an effect.
  59.  
  60.      If this macro is not defined, it means that no insn clobbers
  61.      registers mysteriously.  This is the usual situation; all else
  62.      being equal, it is best for the RTL expression to show all the
  63.      activity.
  64.  
  65. `PRESERVE_DEATH_INFO_REGNO_P (REGNO)'
  66.      If defined, this is a C expression whose value is nonzero if
  67.      accurate `REG_DEAD' notes are needed for hard register number REGNO
  68.      at the time of outputting the assembler code.  When this is so, a
  69.      few optimizations that take place after register allocation and
  70.      could invalidate the death notes are not done when this register is
  71.      involved.
  72.  
  73.      You would arrange to preserve death info for a register when some
  74.      of the code in the machine description which is executed to write
  75.      the assembler code looks at the death notes.  This is necessary
  76.      only when the actual hardware feature which GNU CC thinks of as a
  77.      register is not actually a register of the usual sort.  (It might,
  78.      for example, be a hardware stack.)
  79.  
  80.      If this macro is not defined, it means that no death notes need to
  81.      be preserved.  This is the usual situation.
  82.  
  83. File: gcc.info,  Node: Register Classes,  Next: Stack and Calling,  Prev: Registers,  Up: Target Macros
  84.  
  85. Register Classes
  86. ================
  87.  
  88.    On many machines, the numbered registers are not all equivalent.
  89. For example, certain registers may not be allowed for indexed
  90. addressing; certain registers may not be allowed in some instructions.
  91. These machine restrictions are described to the compiler using
  92. "register classes".
  93.  
  94.    You define a number of register classes, giving each one a name and
  95. saying which of the registers belong to it.  Then you can specify
  96. register classes that are allowed as operands to particular instruction
  97. patterns.
  98.  
  99.    In general, each register will belong to several classes.  In fact,
  100. one class must be named `ALL_REGS' and contain all the registers.
  101. Another class must be named `NO_REGS' and contain no registers.  Often
  102. the union of two classes will be another class; however, this is not
  103. required.
  104.  
  105.    One of the classes must be named `GENERAL_REGS'.  There is nothing
  106. terribly special about the name, but the operand constraint letters `r'
  107. and `g' specify this class.  If `GENERAL_REGS' is the same as
  108. `ALL_REGS', just define it as a macro which expands to `ALL_REGS'.
  109.  
  110.    Order the classes so that if class X is contained in class Y then X
  111. has a lower class number than Y.
  112.  
  113.    The way classes other than `GENERAL_REGS' are specified in operand
  114. constraints is through machine-dependent operand constraint letters.
  115. You can define such letters to correspond to various classes, then use
  116. them in operand constraints.
  117.  
  118.    You should define a class for the union of two classes whenever some
  119. instruction allows both classes.  For example, if an instruction allows
  120. either a floating point (coprocessor) register or a general register
  121. for a certain operand, you should define a class `FLOAT_OR_GENERAL_REGS'
  122. which includes both of them.  Otherwise you will get suboptimal code.
  123.  
  124.    You must also specify certain redundant information about the
  125. register classes: for each class, which classes contain it and which
  126. ones are contained in it; for each pair of classes, the largest class
  127. contained in their union.
  128.  
  129.    When a value occupying several consecutive registers is expected in a
  130. certain class, all the registers used must belong to that class.
  131. Therefore, register classes cannot be used to enforce a requirement for
  132. a register pair to start with an even-numbered register.  The way to
  133. specify this requirement is with `HARD_REGNO_MODE_OK'.
  134.  
  135.    Register classes used for input-operands of bitwise-and or shift
  136. instructions have a special requirement: each such class must have, for
  137. each fixed-point machine mode, a subclass whose registers can transfer
  138. that mode to or from memory.  For example, on some machines, the
  139. operations for single-byte values (`QImode') are limited to certain
  140. registers.  When this is so, each register class that is used in a
  141. bitwise-and or shift instruction must have a subclass consisting of
  142. registers from which single-byte values can be loaded or stored.  This
  143. is so that `PREFERRED_RELOAD_CLASS' can always have a possible value to
  144. return.
  145.  
  146. `enum reg_class'
  147.      An enumeral type that must be defined with all the register class
  148.      names as enumeral values.  `NO_REGS' must be first.  `ALL_REGS'
  149.      must be the last register class, followed by one more enumeral
  150.      value, `LIM_REG_CLASSES', which is not a register class but rather
  151.      tells how many classes there are.
  152.  
  153.      Each register class has a number, which is the value of casting
  154.      the class name to type `int'.  The number serves as an index in
  155.      many of the tables described below.
  156.  
  157. `N_REG_CLASSES'
  158.      The number of distinct register classes, defined as follows:
  159.  
  160.           #define N_REG_CLASSES (int) LIM_REG_CLASSES
  161.  
  162. `REG_CLASS_NAMES'
  163.      An initializer containing the names of the register classes as C
  164.      string constants.  These names are used in writing some of the
  165.      debugging dumps.
  166.  
  167. `REG_CLASS_CONTENTS'
  168.      An initializer containing the contents of the register classes, as
  169.      integers which are bit masks.  The Nth integer specifies the
  170.      contents of class N.  The way the integer MASK is interpreted is
  171.      that register R is in the class if `MASK & (1 << R)' is 1.
  172.  
  173.      When the machine has more than 32 registers, an integer does not
  174.      suffice.  Then the integers are replaced by sub-initializers,
  175.      braced groupings containing several integers.  Each
  176.      sub-initializer must be suitable as an initializer for the type
  177.      `HARD_REG_SET' which is defined in `hard-reg-set.h'.
  178.  
  179. `REGNO_REG_CLASS (REGNO)'
  180.      A C expression whose value is a register class containing hard
  181.      register REGNO.  In general there is more than one such class;
  182.      choose a class which is "minimal", meaning that no smaller class
  183.      also contains the register.
  184.  
  185. `BASE_REG_CLASS'
  186.      A macro whose definition is the name of the class to which a valid
  187.      base register must belong.  A base register is one used in an
  188.      address which is the register value plus a displacement.
  189.  
  190. `INDEX_REG_CLASS'
  191.      A macro whose definition is the name of the class to which a valid
  192.      index register must belong.  An index register is one used in an
  193.      address where its value is either multiplied by a scale factor or
  194.      added to another register (as well as added to a displacement).
  195.  
  196. `REG_CLASS_FROM_LETTER (CHAR)'
  197.      A C expression which defines the machine-dependent operand
  198.      constraint letters for register classes.  If CHAR is such a
  199.      letter, the value should be the register class corresponding to
  200.      it.  Otherwise, the value should be `NO_REGS'.  The register
  201.      letter `r', corresponding to class `GENERAL_REGS', will not be
  202.      passed to this macro; you do not need to handle it.
  203.  
  204. `REGNO_OK_FOR_BASE_P (NUM)'
  205.      A C expression which is nonzero if register number NUM is suitable
  206.      for use as a base register in operand addresses.  It may be either
  207.      a suitable hard register or a pseudo register that has been
  208.      allocated such a hard register.
  209.  
  210. `REGNO_OK_FOR_INDEX_P (NUM)'
  211.      A C expression which is nonzero if register number NUM is suitable
  212.      for use as an index register in operand addresses.  It may be
  213.      either a suitable hard register or a pseudo register that has been
  214.      allocated such a hard register.
  215.  
  216.      The difference between an index register and a base register is
  217.      that the index register may be scaled.  If an address involves the
  218.      sum of two registers, neither one of them scaled, then either one
  219.      may be labeled the "base" and the other the "index"; but whichever
  220.      labeling is used must fit the machine's constraints of which
  221.      registers may serve in each capacity.  The compiler will try both
  222.      labelings, looking for one that is valid, and will reload one or
  223.      both registers only if neither labeling works.
  224.  
  225. `PREFERRED_RELOAD_CLASS (X, CLASS)'
  226.      A C expression that places additional restrictions on the register
  227.      class to use when it is necessary to copy value X into a register
  228.      in class CLASS.  The value is a register class; perhaps CLASS, or
  229.      perhaps another, smaller class.  On many machines, the following
  230.      definition is safe:
  231.  
  232.           #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
  233.  
  234.      Sometimes returning a more restrictive class makes better code.
  235.      For example, on the 68000, when X is an integer constant that is
  236.      in range for a `moveq' instruction, the value of this macro is
  237.      always `DATA_REGS' as long as CLASS includes the data registers.
  238.      Requiring a data register guarantees that a `moveq' will be used.
  239.  
  240.      If X is a `const_double', by returning `NO_REGS' you can force X
  241.      into a memory constant.  This is useful on certain machines where
  242.      immediate floating values cannot be loaded into certain kinds of
  243.      registers.
  244.  
  245. `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
  246.      Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
  247.      input reloads.  If you don't define this macro, the default is to
  248.      use CLASS, unchanged.
  249.  
  250. `LIMIT_RELOAD_CLASS (MODE, CLASS)'
  251.      A C expression that places additional restrictions on the register
  252.      class to use when it is necessary to be able to hold a value of
  253.      mode MODE in a reload register for which class CLASS would
  254.      ordinarily be used.
  255.  
  256.      Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
  257.      there are certain modes that simply can't go in certain reload
  258.      classes.
  259.  
  260.      The value is a register class; perhaps CLASS, or perhaps another,
  261.      smaller class.
  262.  
  263.      Don't define this macro unless the target machine has limitations
  264.      which require the macro to do something nontrivial.
  265.  
  266. `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
  267. `SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)'
  268. `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
  269.      Many machines have some registers that cannot be copied directly
  270.      to or from memory or even from other types of registers.  An
  271.      example is the `MQ' register, which on most machines, can only be
  272.      copied to or from general registers, but not memory.  Some
  273.      machines allow copying all registers to and from memory, but
  274.      require a scratch register for stores to some memory locations
  275.      (e.g., those with symbolic address on the RT, and those with
  276.      certain symbolic address on the Sparc when compiling PIC).  In
  277.      some cases, both an intermediate and a scratch register are
  278.      required.
  279.  
  280.      You should define these macros to indicate to the reload phase
  281.      that it may need to allocate at least one register for a reload in
  282.      addition to the register to contain the data.  Specifically, if
  283.      copying X to a register CLASS in MODE requires an intermediate
  284.      register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
  285.      return the largest register class all of whose registers can be
  286.      used as intermediate registers or scratch registers.
  287.  
  288.      If copying a register CLASS in MODE to X requires an intermediate
  289.      or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
  290.      defined to return the largest register class required.  If the
  291.      requirements for input and output reloads are the same, the macro
  292.      `SECONDARY_RELOAD_CLASS' should be used instead of defining both
  293.      macros identically.
  294.  
  295.      The values returned by these macros are often `GENERAL_REGS'.
  296.      Return `NO_REGS' if no spare register is needed; i.e., if X can be
  297.      directly copied to or from a register of CLASS in MODE without
  298.      requiring a scratch register.  Do not define this macro if it
  299.      would always return `NO_REGS'.
  300.  
  301.      If a scratch register is required (either with or without an
  302.      intermediate register), you should define patterns for
  303.      `reload_inM' or `reload_outM', as required (*note Standard
  304.      Names::..  These patterns, which will normally be implemented with
  305.      a `define_expand', should be similar to the `movM' patterns,
  306.      except that operand 2 is the scratch register.
  307.  
  308.      Define constraints for the reload register and scratch register
  309.      that contain a single register class.  If the original reload
  310.      register (whose class is CLASS) can meet the constraint given in
  311.      the pattern, the value returned by these macros is used for the
  312.      class of the scratch register.  Otherwise, two additional reload
  313.      registers are required.  Their classes are obtained from the
  314.      constraints in the insn pattern.
  315.  
  316.      X might be a pseudo-register or a `subreg' of a pseudo-register,
  317.      which could either be in a hard register or in memory.  Use
  318.      `true_regnum' to find out; it will return -1 if the pseudo is in
  319.      memory and the hard register number if it is in a register.
  320.  
  321.      These macros should not be used in the case where a particular
  322.      class of registers can only be copied to memory and not to another
  323.      class of registers.  In that case, secondary reload registers are
  324.      not needed and would not be helpful.  Instead, a stack location
  325.      must be used to perform the copy and the `movM' pattern should use
  326.      memory as a intermediate storage.  This case often occurs between
  327.      floating-point and general registers.
  328.  
  329. `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
  330.      Certain machines have the property that some registers cannot be
  331.      copied to some other registers without using memory.  Define this
  332.      macro on those machines to be a C expression that is non-zero if
  333.      objects of mode M in registers of CLASS1 can only be copied to
  334.      registers of class CLASS2 by storing a register of CLASS1 into
  335.      memory and loading that memory location into a register of CLASS2.
  336.  
  337.      Do not define this macro if its value would always be zero.
  338.  
  339. `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
  340.      Normally, when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
  341.      will allocate a stack slot when a memory location for a register
  342.      copy is needed.  If this macro is defined, the compiler instead
  343.      uses the memory location defined by this macro.
  344.  
  345. `SMALL_REGISTER_CLASSES'
  346.      Normally the compiler will avoid choosing spill registers from
  347.      registers that have been explicitly mentioned in the rtl (these
  348.      registers are normally those used to pass parameters and return
  349.      values).  However, some machines have so few registers of certain
  350.      classes that there would not be enough registers to use as spill
  351.      registers if this were done.
  352.  
  353.      You should define `SMALL_REGISTER_CLASSES' on those machines.  When
  354.      it is defined, the compiler allows registers explicitly used in
  355.      the rtl to be used as spill registers but prevents the compiler
  356.      from extending the lifetime of these registers.
  357.  
  358.      Defining this macro is always safe, but unnecessarily defining
  359.      this macro will reduce the amount of optimizations that can be
  360.      performed in some cases.  If this macro is not defined but needs
  361.      to be, the compiler will run out of reload registers and print a
  362.      fatal error message.
  363.  
  364.      For most machines, this macro should not be defined.
  365.  
  366. `CLASS_LIKELY_SPILLED_P (CLASS)'
  367.      A C expression whose value is nonzero if pseudos that have been
  368.      assigned to registers of class CLASS would likely be spilled
  369.      because registers of CLASS are needed for spill registers.
  370.  
  371.      The default value of this macro returns 1 if CLASS has exactly one
  372.      register and zero otherwise.  On most machines, this default
  373.      should be used.  Only define this macro to some other expression
  374.      if pseudo allocated by `local-alloc.c' end up in memory because
  375.      their hard registers were needed for spill regisers.  If this
  376.      macro returns nonzero for those classes, those pseudos will only
  377.      be allocated by `global.c', which knows how to reallocate the
  378.      pseudo to another register.  If there would not be another
  379.      register available for reallocation, you should not change the
  380.      definition of this macro since the only effect of such a
  381.      definition would be to slow down register allocation.
  382.  
  383. `CLASS_MAX_NREGS (CLASS, MODE)'
  384.      A C expression for the maximum number of consecutive registers of
  385.      class CLASS needed to hold a value of mode MODE.
  386.  
  387.      This is closely related to the macro `HARD_REGNO_NREGS'.  In fact,
  388.      the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
  389.      the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
  390.      REGNO values in the class CLASS.
  391.  
  392.      This macro helps control the handling of multiple-word values in
  393.      the reload pass.
  394.  
  395.    Three other special macros describe which operands fit which
  396. constraint letters.
  397.  
  398. `CONST_OK_FOR_LETTER_P (VALUE, C)'
  399.      A C expression that defines the machine-dependent operand
  400.      constraint letters that specify particular ranges of integer
  401.      values.  If C is one of those letters, the expression should check
  402.      that VALUE, an integer, is in the appropriate range and return 1
  403.      if so, 0 otherwise.  If C is not one of those letters, the value
  404.      should be 0 regardless of VALUE.
  405.  
  406. `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
  407.      A C expression that defines the machine-dependent operand
  408.      constraint letters that specify particular ranges of
  409.      `const_double' values.
  410.  
  411.      If C is one of those letters, the expression should check that
  412.      VALUE, an RTX of code `const_double', is in the appropriate range
  413.      and return 1 if so, 0 otherwise.  If C is not one of those
  414.      letters, the value should be 0 regardless of VALUE.
  415.  
  416.      `const_double' is used for all floating-point constants and for
  417.      `DImode' fixed-point constants.  A given letter can accept either
  418.      or both kinds of values.  It can use `GET_MODE' to distinguish
  419.      between these kinds.
  420.  
  421. `EXTRA_CONSTRAINT (VALUE, C)'
  422.      A C expression that defines the optional machine-dependent
  423.      constraint letters that can be used to segregate specific types of
  424.      operands, usually memory references, for the target machine.
  425.      Normally this macro will not be defined.  If it is required for a
  426.      particular target machine, it should return 1 if VALUE corresponds
  427.      to the operand type represented by the constraint letter C.  If C
  428.      is not defined as an extra constraint, the value returned should
  429.      be 0 regardless of VALUE.
  430.  
  431.      For example, on the ROMP, load instructions cannot have their
  432.      output in r0 if the memory reference contains a symbolic address.
  433.      Constraint letter `Q' is defined as representing a memory address
  434.      that does *not* contain a symbolic address.  An alternative is
  435.      specified with a `Q' constraint on the input and `r' on the
  436.      output.  The next alternative specifies `m' on the input and a
  437.      register class that does not include r0 on the output.
  438.  
  439. File: gcc.info,  Node: Stack and Calling,  Next: Varargs,  Prev: Register Classes,  Up: Target Macros
  440.  
  441. Stack Layout and Calling Conventions
  442. ====================================
  443.  
  444. * Menu:
  445.  
  446. * Frame Layout::
  447. * Frame Registers::
  448. * Elimination::
  449. * Stack Arguments::
  450. * Register Arguments::
  451. * Scalar Return::
  452. * Aggregate Return::
  453. * Caller Saves::
  454. * Function Entry::
  455. * Profiling::
  456.  
  457. File: gcc.info,  Node: Frame Layout,  Next: Frame Registers,  Up: Stack and Calling
  458.  
  459. Basic Stack Layout
  460. ------------------
  461.  
  462. `STACK_GROWS_DOWNWARD'
  463.      Define this macro if pushing a word onto the stack moves the stack
  464.      pointer to a smaller address.
  465.  
  466.      When we say, "define this macro if ...," it means that the
  467.      compiler checks this macro only with `#ifdef' so the precise
  468.      definition used does not matter.
  469.  
  470. `FRAME_GROWS_DOWNWARD'
  471.      Define this macro if the addresses of local variable slots are at
  472.      negative offsets from the frame pointer.
  473.  
  474. `ARGS_GROW_DOWNWARD'
  475.      Define this macro if successive arguments to a function occupy
  476.      decreasing addresses on the stack.
  477.  
  478. `STARTING_FRAME_OFFSET'
  479.      Offset from the frame pointer to the first local variable slot to
  480.      be allocated.
  481.  
  482.      If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
  483.      subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
  484.      Otherwise, it is found by adding the length of the first slot to
  485.      the value `STARTING_FRAME_OFFSET'.
  486.  
  487. `STACK_POINTER_OFFSET'
  488.      Offset from the stack pointer register to the first location at
  489.      which outgoing arguments are placed.  If not specified, the
  490.      default value of zero is used.  This is the proper value for most
  491.      machines.
  492.  
  493.      If `ARGS_GROW_DOWNWARD', this is the offset to the location above
  494.      the first location at which outgoing arguments are placed.
  495.  
  496. `FIRST_PARM_OFFSET (FUNDECL)'
  497.      Offset from the argument pointer register to the first argument's
  498.      address.  On some machines it may depend on the data type of the
  499.      function.
  500.  
  501.      If `ARGS_GROW_DOWNWARD', this is the offset to the location above
  502.      the first argument's address.
  503.  
  504. `STACK_DYNAMIC_OFFSET (FUNDECL)'
  505.      Offset from the stack pointer register to an item dynamically
  506.      allocated on the stack, e.g., by `alloca'.
  507.  
  508.      The default value for this macro is `STACK_POINTER_OFFSET' plus the
  509.      length of the outgoing arguments.  The default is correct for most
  510.      machines.  See `function.c' for details.
  511.  
  512. `DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)'
  513.      A C expression whose value is RTL representing the address in a
  514.      stack frame where the pointer to the caller's frame is stored.
  515.      Assume that FRAMEADDR is an RTL expression for the address of the
  516.      stack frame itself.
  517.  
  518.      If you don't define this macro, the default is to return the value
  519.      of FRAMEADDR--that is, the stack frame address is also the address
  520.      of the stack word that points to the previous frame.
  521.  
  522. `SERTUP_FRAME_ADDRESSES ()'
  523.      If defined, a C expression that produces the machine-specific code
  524.      to setup the stack so that arbitrary frames can be accessed.  For
  525.      example, on the Sparc, we must flush all of the register windows
  526.      to the stack before we can access arbitrary stack frames.  This
  527.      macro will seldom need to be defined.
  528.  
  529. `RETURN_ADDR_RTX (COUNT, FRAMEADDR)'
  530.      A C expression whose value is RTL representing the value of the
  531.      return address for the frame COUNT steps up from the current frame.
  532.      fRAMEADDR is the frame pointer of the COUNT frame, or the frame
  533.      pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME'
  534.      is defined.
  535.  
  536. `RETURN_ADDR_IN_PREVIOUS_FRAME'
  537.      Define this if the return address of a particular stack frame is
  538.      accessed from the frame pointer of the previous stack frame.
  539.  
  540. File: gcc.info,  Node: Frame Registers,  Next: Elimination,  Prev: Frame Layout,  Up: Stack and Calling
  541.  
  542. Registers That Address the Stack Frame
  543. --------------------------------------
  544.  
  545. `STACK_POINTER_REGNUM'
  546.      The register number of the stack pointer register, which must also
  547.      be a fixed register according to `FIXED_REGISTERS'.  On most
  548.      machines, the hardware determines which register this is.
  549.  
  550. `FRAME_POINTER_REGNUM'
  551.      The register number of the frame pointer register, which is used to
  552.      access automatic variables in the stack frame.  On some machines,
  553.      the hardware determines which register this is.  On other
  554.      machines, you can choose any register you wish for this purpose.
  555.  
  556. `HARD_FRAME_POINTER_REGNUM'
  557.      On some machines the offset between the frame pointer and starting
  558.      offset of the automatic variables is not known until after register
  559.      allocation has been done (for example, because the saved registers
  560.      are between these two locations).  On those machines,
  561.      `FRAME_POINTER_REGNUM' as a special, fixed register to be used
  562.      internally until the offset is known, and define
  563.      `HARD_FRAME_POINTER_REGNUM' to be the hard register used for the
  564.      frame pointer.
  565.  
  566.      You should define this macro only in the very rare circumstances
  567.      when it is not possible to calculate the offset between the frame
  568.      pointer and the automatic variables until after register
  569.      allocation has been completed.  When this macro is defined, you
  570.      must also indicate in your definition of `ELIMINABLE_REGS' how to
  571.      eliminate `FRAME_POINTER_REGNUM' into either
  572.      `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'.
  573.  
  574.      Do not define this macro if it would be the same as
  575.      `FRAME_POINTER_REGNUM'.
  576.  
  577. `ARG_POINTER_REGNUM'
  578.      The register number of the arg pointer register, which is used to
  579.      access the function's argument list.  On some machines, this is
  580.      the same as the frame pointer register.  On some machines, the
  581.      hardware determines which register this is.  On other machines,
  582.      you can choose any register you wish for this purpose.  If this is
  583.      not the same register as the frame pointer register, then you must
  584.      mark it as a fixed register according to `FIXED_REGISTERS', or
  585.      arrange to be able to eliminate it (*note Elimination::.).
  586.  
  587. `STATIC_CHAIN_REGNUM'
  588. `STATIC_CHAIN_INCOMING_REGNUM'
  589.      Register numbers used for passing a function's static chain
  590.      pointer.  If register windows are used, the register number as
  591.      seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
  592.      while the register number as seen by the calling function is
  593.      `STATIC_CHAIN_REGNUM'.  If these registers are the same,
  594.      `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
  595.  
  596.      The static chain register need not be a fixed register.
  597.  
  598.      If the static chain is passed in memory, these macros should not be
  599.      defined; instead, the next two macros should be defined.
  600.  
  601. `STATIC_CHAIN'
  602. `STATIC_CHAIN_INCOMING'
  603.      If the static chain is passed in memory, these macros provide rtx
  604.      giving `mem' expressions that denote where they are stored.
  605.      `STATIC_CHAIN' and `STATIC_CHAIN_INCOMING' give the locations as
  606.      seen by the calling and called functions, respectively.  Often the
  607.      former will be at an offset from the stack pointer and the latter
  608.      at an offset from the frame pointer.
  609.  
  610.      The variables `stack_pointer_rtx', `frame_pointer_rtx', and
  611.      `arg_pointer_rtx' will have been initialized prior to the use of
  612.      these macros and should be used to refer to those items.
  613.  
  614.      If the static chain is passed in a register, the two previous
  615.      macros should be defined instead.
  616.  
  617. File: gcc.info,  Node: Elimination,  Next: Stack Arguments,  Prev: Frame Registers,  Up: Stack and Calling
  618.  
  619. Eliminating Frame Pointer and Arg Pointer
  620. -----------------------------------------
  621.  
  622. `FRAME_POINTER_REQUIRED'
  623.      A C expression which is nonzero if a function must have and use a
  624.      frame pointer.  This expression is evaluated  in the reload pass.
  625.      If its value is nonzero the function will have a frame pointer.
  626.  
  627.      The expression can in principle examine the current function and
  628.      decide according to the facts, but on most machines the constant 0
  629.      or the constant 1 suffices.  Use 0 when the machine allows code to
  630.      be generated with no frame pointer, and doing so saves some time
  631.      or space.  Use 1 when there is no possible advantage to avoiding a
  632.      frame pointer.
  633.  
  634.      In certain cases, the compiler does not know how to produce valid
  635.      code without a frame pointer.  The compiler recognizes those cases
  636.      and automatically gives the function a frame pointer regardless of
  637.      what `FRAME_POINTER_REQUIRED' says.  You don't need to worry about
  638.      them.
  639.  
  640.      In a function that does not require a frame pointer, the frame
  641.      pointer register can be allocated for ordinary usage, unless you
  642.      mark it as a fixed register.  See `FIXED_REGISTERS' for more
  643.      information.
  644.  
  645.      This macro is ignored and you do not need to define it if the
  646.      function `ELIMINABLE_REGS' is defined.
  647.  
  648. `INITIAL_FRAME_POINTER_OFFSET (DEPTH-VAR)'
  649.      A C statement to store in the variable DEPTH-VAR the difference
  650.      between the frame pointer and the stack pointer values immediately
  651.      after the function prologue.  The value would be computed from
  652.      information such as the result of `get_frame_size ()' and the
  653.      tables of registers `regs_ever_live' and `call_used_regs'.
  654.  
  655.      If `ELIMINABLE_REGS' is defined, this macro will be not be used and
  656.      need not be defined.  Otherwise, it must be defined even if
  657.      `FRAME_POINTER_REQUIRED' is defined to always be true; in that
  658.      case, you may set DEPTH-VAR to anything.
  659.  
  660. `ELIMINABLE_REGS'
  661.      If defined, this macro specifies a table of register pairs used to
  662.      eliminate unneeded registers that point into the stack frame.  If
  663.      it is not defined, the only elimination attempted by the compiler
  664.      is to replace references to the frame pointer with references to
  665.      the stack pointer.
  666.  
  667.      The definition of this macro is a list of structure
  668.      initializations, each of which specifies an original and
  669.      replacement register.
  670.  
  671.      On some machines, the position of the argument pointer is not
  672.      known until the compilation is completed.  In such a case, a
  673.      separate hard register must be used for the argument pointer.
  674.      This register can be eliminated by replacing it with either the
  675.      frame pointer or the argument pointer, depending on whether or not
  676.      the frame pointer has been eliminated.
  677.  
  678.      In this case, you might specify:
  679.           #define ELIMINABLE_REGS  \
  680.           {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
  681.            {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
  682.            {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
  683.  
  684.      Note that the elimination of the argument pointer with the stack
  685.      pointer is specified first since that is the preferred elimination.
  686.  
  687. `CAN_ELIMINATE (FROM-REG, TO-REG)'
  688.      A C expression that returns non-zero if the compiler is allowed to
  689.      try to replace register number FROM-REG with register number
  690.      TO-REG.  This macro need only be defined if `ELIMINABLE_REGS' is
  691.      defined, and will usually be the constant 1, since most of the
  692.      cases preventing register elimination are things that the compiler
  693.      already knows about.
  694.  
  695. `INITIAL_ELIMINATION_OFFSET (FROM-REG, TO-REG, OFFSET-VAR)'
  696.      This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It
  697.      specifies the initial difference between the specified pair of
  698.      registers.  This macro must be defined if `ELIMINABLE_REGS' is
  699.      defined.
  700.  
  701. `LONGJMP_RESTORE_FROM_STACK'
  702.      Define this macro if the `longjmp' function restores registers from
  703.      the stack frames, rather than from those saved specifically by
  704.      `setjmp'.  Certain quantities must not be kept in registers across
  705.      a call to `setjmp' on such machines.
  706.  
  707. File: gcc.info,  Node: Stack Arguments,  Next: Register Arguments,  Prev: Elimination,  Up: Stack and Calling
  708.  
  709. Passing Function Arguments on the Stack
  710. ---------------------------------------
  711.  
  712.    The macros in this section control how arguments are passed on the
  713. stack.  See the following section for other macros that control passing
  714. certain arguments in registers.
  715.  
  716. `PROMOTE_PROTOTYPES'
  717.      Define this macro if an argument declared in a prototype as an
  718.      integral type smaller than `int' should actually be passed as an
  719.      `int'.  In addition to avoiding errors in certain cases of
  720.      mismatch, it also makes for better code on certain machines.
  721.  
  722. `PUSH_ROUNDING (NPUSHED)'
  723.      A C expression that is the number of bytes actually pushed onto the
  724.      stack when an instruction attempts to push NPUSHED bytes.
  725.  
  726.      If the target machine does not have a push instruction, do not
  727.      define this macro.  That directs GNU CC to use an alternate
  728.      strategy: to allocate the entire argument block and then store the
  729.      arguments into it.
  730.  
  731.      On some machines, the definition
  732.  
  733.           #define PUSH_ROUNDING(BYTES) (BYTES)
  734.  
  735.      will suffice.  But on other machines, instructions that appear to
  736.      push one byte actually push two bytes in an attempt to maintain
  737.      alignment.  Then the definition should be
  738.  
  739.           #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
  740.  
  741. `ACCUMULATE_OUTGOING_ARGS'
  742.      If defined, the maximum amount of space required for outgoing
  743.      arguments will be computed and placed into the variable
  744.      `current_function_outgoing_args_size'.  No space will be pushed
  745.      onto the stack for each call; instead, the function prologue should
  746.      increase the stack frame size by this amount.
  747.  
  748.      Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is
  749.      not proper.
  750.  
  751. `REG_PARM_STACK_SPACE (FNDECL)'
  752.      Define this macro if functions should assume that stack space has
  753.      been allocated for arguments even when their values are passed in
  754.      registers.
  755.  
  756.      The value of this macro is the size, in bytes, of the area
  757.      reserved for arguments passed in registers for the function
  758.      represented by FNDECL.
  759.  
  760.      This space can be allocated by the caller, or be a part of the
  761.      machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says
  762.      which.
  763.  
  764. `MAYBE_REG_PARM_STACK_SPACE'
  765. `FINAL_REG_PARM_STACK_SPACE (CONST_SIZE, VAR_SIZE)'
  766.      Define these macros in addition to the one above if functions might
  767.      allocate stack space for arguments even when their values are
  768.      passed in registers.  These should be used when the stack space
  769.      allocated for arguments in registers is not a simple constant
  770.      independent of the function declaration.
  771.  
  772.      The value of the first macro is the size, in bytes, of the area
  773.      that we should initially assume would be reserved for arguments
  774.      passed in registers.
  775.  
  776.      The value of the second macro is the actual size, in bytes, of the
  777.      area that will be reserved for arguments passed in registers.
  778.      This takes two arguments: an integer representing the number of
  779.      bytes of fixed sized arguments on the stack, and a tree
  780.      representing the number of bytes of variable sized arguments on
  781.      the stack.
  782.  
  783.      When these macros are defined, `REG_PARM_STACK_SPACE' will only be
  784.      called for libcall functions, the current function, or for a
  785.      function being called when it is known that such stack space must
  786.      be allocated.  In each case this value can be easily computed.
  787.  
  788.      When deciding whether a called function needs such stack space,
  789.      and how much space to reserve, GNU CC uses these two macros
  790.      instead of `REG_PARM_STACK_SPACE'.
  791.  
  792. `OUTGOING_REG_PARM_STACK_SPACE'
  793.      Define this if it is the responsibility of the caller to allocate
  794.      the area reserved for arguments passed in registers.
  795.  
  796.      If `ACCUMULATE_OUTGOING_ARGS' is defined, this macro controls
  797.      whether the space for these arguments counts in the value of
  798.      `current_function_outgoing_args_size'.
  799.  
  800. `STACK_PARMS_IN_REG_PARM_AREA'
  801.      Define this macro if `REG_PARM_STACK_SPACE' is defined, but the
  802.      stack parameters don't skip the area specified by it.
  803.  
  804.      Normally, when a parameter is not passed in registers, it is
  805.      placed on the stack beyond the `REG_PARM_STACK_SPACE' area.
  806.      Defining this macro suppresses this behavior and causes the
  807.      parameter to be passed on the stack in its natural location.
  808.  
  809. `RETURN_POPS_ARGS (FUNTYPE, STACK-SIZE)'
  810.      A C expression that should indicate the number of bytes of its own
  811.      arguments that a function pops on returning, or 0 if the function
  812.      pops no arguments and the caller must therefore pop them all after
  813.      the function returns.
  814.  
  815.      FUNTYPE is a C variable whose value is a tree node that describes
  816.      the function in question.  Normally it is a node of type
  817.      `FUNCTION_TYPE' that describes the data type of the function.
  818.      From this it is possible to obtain the data types of the value and
  819.      arguments (if known).
  820.  
  821.      When a call to a library function is being considered, FUNTYPE
  822.      will contain an identifier node for the library function.  Thus, if
  823.      you need to distinguish among various library functions, you can
  824.      do so by their names.  Note that "library function" in this
  825.      context means a function used to perform arithmetic, whose name is
  826.      known specially in the compiler and was not mentioned in the C
  827.      code being compiled.
  828.  
  829.      STACK-SIZE is the number of bytes of arguments passed on the
  830.      stack.  If a variable number of bytes is passed, it is zero, and
  831.      argument popping will always be the responsibility of the calling
  832.      function.
  833.  
  834.      On the Vax, all functions always pop their arguments, so the
  835.      definition of this macro is STACK-SIZE.  On the 68000, using the
  836.      standard calling convention, no functions pop their arguments, so
  837.      the value of the macro is always 0 in this case.  But an
  838.      alternative calling convention is available in which functions
  839.      that take a fixed number of arguments pop them but other functions
  840.      (such as `printf') pop nothing (the caller pops all).  When this
  841.      convention is in use, FUNTYPE is examined to determine whether a
  842.      function takes a fixed number of arguments.
  843.  
  844. File: gcc.info,  Node: Register Arguments,  Next: Scalar Return,  Prev: Stack Arguments,  Up: Stack and Calling
  845.  
  846. Passing Arguments in Registers
  847. ------------------------------
  848.  
  849.    This section describes the macros which let you control how various
  850. types of arguments are passed in registers or how they are arranged in
  851. the stack.
  852.  
  853. `FUNCTION_ARG (CUM, MODE, TYPE, NAMED)'
  854.      A C expression that controls whether a function argument is passed
  855.      in a register, and which register.
  856.  
  857.      The arguments are CUM, which summarizes all the previous
  858.      arguments; MODE, the machine mode of the argument; TYPE, the data
  859.      type of the argument as a tree node or 0 if that is not known
  860.      (which happens for C support library functions); and NAMED, which
  861.      is 1 for an ordinary argument and 0 for nameless arguments that
  862.      correspond to `...' in the called function's prototype.
  863.  
  864.      The value of the expression should either be a `reg' RTX for the
  865.      hard register in which to pass the argument, or zero to pass the
  866.      argument on the stack.
  867.  
  868.      For machines like the Vax and 68000, where normally all arguments
  869.      are pushed, zero suffices as a definition.
  870.  
  871.      The usual way to make the ANSI library `stdarg.h' work on a machine
  872.      where some arguments are usually passed in registers, is to cause
  873.      nameless arguments to be passed on the stack instead.  This is done
  874.      by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
  875.  
  876.      You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
  877.      definition of this macro to determine if this argument is of a
  878.      type that must be passed in the stack.  If `REG_PARM_STACK_SPACE'
  879.      is not defined and `FUNCTION_ARG' returns non-zero for such an
  880.      argument, the compiler will abort.  If `REG_PARM_STACK_SPACE' is
  881.      defined, the argument will be computed in the stack and then
  882.      loaded into a register.
  883.  
  884. `FUNCTION_INCOMING_ARG (CUM, MODE, TYPE, NAMED)'
  885.      Define this macro if the target machine has "register windows", so
  886.      that the register in which a function sees an arguments is not
  887.      necessarily the same as the one in which the caller passed the
  888.      argument.
  889.  
  890.      For such machines, `FUNCTION_ARG' computes the register in which
  891.      the caller passes the value, and `FUNCTION_INCOMING_ARG' should be
  892.      defined in a similar fashion to tell the function being called
  893.      where the arguments will arrive.
  894.  
  895.      If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves
  896.      both purposes.
  897.  
  898. `FUNCTION_ARG_PARTIAL_NREGS (CUM, MODE, TYPE, NAMED)'
  899.      A C expression for the number of words, at the beginning of an
  900.      argument, must be put in registers.  The value must be zero for
  901.      arguments that are passed entirely in registers or that are
  902.      entirely pushed on the stack.
  903.  
  904.      On some machines, certain arguments must be passed partially in
  905.      registers and partially in memory.  On these machines, typically
  906.      the first N words of arguments are passed in registers, and the
  907.      rest on the stack.  If a multi-word argument (a `double' or a
  908.      structure) crosses that boundary, its first few words must be
  909.      passed in registers and the rest must be pushed.  This macro tells
  910.      the compiler when this occurs, and how many of the words should go
  911.      in registers.
  912.  
  913.      `FUNCTION_ARG' for these arguments should return the first
  914.      register to be used by the caller for this argument; likewise
  915.      `FUNCTION_INCOMING_ARG', for the called function.
  916.  
  917. `FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)'
  918.      A C expression that indicates when an argument must be passed by
  919.      reference.  If nonzero for an argument, a copy of that argument is
  920.      made in memory and a pointer to the argument is passed instead of
  921.      the argument itself.  The pointer is passed in whatever way is
  922.      appropriate for passing a pointer to that type.
  923.  
  924.      On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable
  925.      definition of this macro might be
  926.           #define FUNCTION_ARG_PASS_BY_REFERENCE\
  927.           (CUM, MODE, TYPE, NAMED)  \
  928.             MUST_PASS_IN_STACK (MODE, TYPE)
  929.  
  930. `FUNCTION_ARG_CALLEE_COPIES (CUM, MODE, TYPE, NAMED)'
  931.      If defined, a C expression that indicates when it is the called
  932.      function's responsibility to make a copy of arguments passed by
  933.      invisible reference.  Normally, the caller makes a copy and passes
  934.      the address of the copy to the routine being called.  When
  935.      FUNCTION_ARG_CALLEE_COPIES is defined and is nonzero, the caller
  936.      does not make a copy.  Instead, it passes a pointer to the "live"
  937.      value.  The called function must not modify this value.  If it can
  938.      be determined that the value won't be modified, it need not make a
  939.      copy; otherwise a copy must be made.
  940.  
  941. `CUMULATIVE_ARGS'
  942.      A C type for declaring a variable that is used as the first
  943.      argument of `FUNCTION_ARG' and other related values.  For some
  944.      target machines, the type `int' suffices and can hold the number
  945.      of bytes of argument so far.
  946.  
  947.      There is no need to record in `CUMULATIVE_ARGS' anything about the
  948.      arguments that have been passed on the stack.  The compiler has
  949.      other variables to keep track of that.  For target machines on
  950.      which all arguments are passed on the stack, there is no need to
  951.      store anything in `CUMULATIVE_ARGS'; however, the data structure
  952.      must exist and should not be empty, so use `int'.
  953.  
  954. `INIT_CUMULATIVE_ARGS (CUM, FNTYPE, LIBNAME)'
  955.      A C statement (sans semicolon) for initializing the variable CUM
  956.      for the state at the beginning of the argument list.  The variable
  957.      has type `CUMULATIVE_ARGS'.  The value of FNTYPE is the tree node
  958.      for the data type of the function which will receive the args, or 0
  959.      if the args are to a compiler support library function.
  960.  
  961.      When processing a call to a compiler support library function,
  962.      LIBNAME identifies which one.  It is a `symbol_ref' rtx which
  963.      contains the name of the function, as a string.  LIBNAME is 0 when
  964.      an ordinary C function call is being processed.  Thus, each time
  965.      this macro is called, either LIBNAME or FNTYPE is nonzero, but
  966.      never both of them at once.
  967.  
  968. `INIT_CUMULATIVE_INCOMING_ARGS (CUM, FNTYPE, LIBNAME)'
  969.      Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of
  970.      finding the arguments for the function being compiled.  If this
  971.      macro is undefined, `INIT_CUMULATIVE_ARGS' is used instead.
  972.  
  973.      The value passed for LIBNAME is always 0, since library routines
  974.      with special calling conventions are never compiled with GNU CC.
  975.      The argument LIBNAME exists for symmetry with
  976.      `INIT_CUMULATIVE_ARGS'.
  977.  
  978. `FUNCTION_ARG_ADVANCE (CUM, MODE, TYPE, NAMED)'
  979.      A C statement (sans semicolon) to update the summarizer variable
  980.      CUM to advance past an argument in the argument list.  The values
  981.      MODE, TYPE and NAMED describe that argument.  Once this is done,
  982.      the variable CUM is suitable for analyzing the *following*
  983.      argument with `FUNCTION_ARG', etc.
  984.  
  985.      This macro need not do anything if the argument in question was
  986.      passed on the stack.  The compiler knows how to track the amount
  987.      of stack space used for arguments without any special help.
  988.  
  989. `FUNCTION_ARG_PADDING (MODE, TYPE)'
  990.      If defined, a C expression which determines whether, and in which
  991.      direction, to pad out an argument with extra space.  The value
  992.      should be of type `enum direction': either `upward' to pad above
  993.      the argument, `downward' to pad below, or `none' to inhibit
  994.      padding.
  995.  
  996.      The *amount* of padding is always just enough to reach the next
  997.      multiple of `FUNCTION_ARG_BOUNDARY'; this macro does not control
  998.      it.
  999.  
  1000.      This macro has a default definition which is right for most
  1001.      systems.  For little-endian machines, the default is to pad
  1002.      upward.  For big-endian machines, the default is to pad downward
  1003.      for an argument of constant size shorter than an `int', and upward
  1004.      otherwise.
  1005.  
  1006. `FUNCTION_ARG_BOUNDARY (MODE, TYPE)'
  1007.      If defined, a C expression that gives the alignment boundary, in
  1008.      bits, of an argument with the specified mode and type.  If it is
  1009.      not defined, `PARM_BOUNDARY' is used for all arguments.
  1010.  
  1011. `FUNCTION_ARG_REGNO_P (REGNO)'
  1012.      A C expression that is nonzero if REGNO is the number of a hard
  1013.      register in which function arguments are sometimes passed.  This
  1014.      does *not* include implicit arguments such as the static chain and
  1015.      the structure-value address.  On many machines, no registers can be
  1016.      used for this purpose since all function arguments are pushed on
  1017.      the stack.
  1018.  
  1019.